/*  1:   */ package com.atomikos.beans;
/*  2:   */ 
/*  3:   */ import java.awt.Component;
/*  4:   */ import java.awt.event.ActionEvent;
/*  5:   */ import java.awt.event.ActionListener;
/*  6:   */ import java.beans.PropertyEditor;
/*  7:   */ import javax.swing.JCheckBox;
/*  8:   */ import javax.swing.JPanel;
/*  9:   */ 
/* 10:   */ public class CheckboxComponent
/* 11:   */   extends AbstractPropertyEditorComponent
/* 12:   */   implements ActionListener
/* 13:   */ {
/* 14:   */   private JCheckBox checkbox_;
/* 15:   */   private JPanel panel_;
/* 16:   */   
/* 17:   */   public CheckboxComponent(Property property)
/* 18:   */     throws PropertyException
/* 19:   */   {
/* 20:54 */     this.panel_ = new JPanel();
/* 21:55 */     Boolean selected = (Boolean)property.getValue();
/* 22:56 */     this.checkbox_ = new JCheckBox();
/* 23:57 */     this.checkbox_.setSelected(selected.booleanValue());
/* 24:58 */     this.checkbox_.setToolTipText(property.getDescription());
/* 25:59 */     this.panel_.add(this.checkbox_);
/* 26:60 */     this.checkbox_.addActionListener(this);
/* 27:   */   }
/* 28:   */   
/* 29:   */   public Component getComponent()
/* 30:   */   {
/* 31:69 */     return this.panel_;
/* 32:   */   }
/* 33:   */   
/* 34:   */   public void actionPerformed(ActionEvent e)
/* 35:   */   {
/* 36:   */     try
/* 37:   */     {
/* 38:79 */       getPropertyEditor().setValue(new Boolean(this.checkbox_.isSelected()));
/* 39:   */     }
/* 40:   */     catch (Exception err)
/* 41:   */     {
/* 42:83 */       err.printStackTrace();
/* 43:   */     }
/* 44:   */   }
/* 45:   */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\atomikos-util\3.7.0\atomikos-util-3.7.0.jar
 * Qualified Name:     com.atomikos.beans.CheckboxComponent
 * JD-Core Version:    0.7.0.1
 */